<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j">

    <ui:composition>
        <rich:modalPanel id="cadastro-membro-modal" autosized="true" moveable="false" resizeable="false">
            <f:facet name="header">
                <h:outputText value="Cadastrar um novo membro"/>
            </f:facet>
            <f:facet name="controls">
                <h:panelGroup>
                    <h:form>
                        <a4j:commandLink>
                            <h:graphicImage id="hidelink" value="/img/close.png" border="0" />
                            <rich:componentControl for="cadastro-membro-modal" operation="hide" event="onclick" />
                        </a4j:commandLink>
                    </h:form>
                </h:panelGroup>
            </f:facet>

            <h:form id="cadastro-membro-modal-form">
                <h:graphicImage style="margin:0 auto;" id="foto" url="#{AdministrarMembrosMB.nomeFoto}" border="0" alt="foto do membro" title="foto do membro"/>
                <h:panelGrid columns="2">
                    foto:
                    <rich:comboBox width="200" value="#{AdministrarMembrosMB.nomeFoto}" directInputSuggestions="false"
                                   defaultLabel="escolha a foto..." >
                        <f:selectItems value="#{AdministrarMembrosMB.listFotos}" />
                        <a4j:support event="onselect" reRender="foto" />
                    </rich:comboBox>
                    login:<h:inputText class="input" value="#{AdministrarMembrosMB.membro.login}" />
                    senha:<h:inputText class="input" value="#{AdministrarMembrosMB.membro.senha}" />
                    nome:<h:inputText class="input" value="#{AdministrarMembrosMB.membro.nome}" />
                    cargo:
                    <rich:comboBox width="200" value="#{AdministrarMembrosMB.nomeCargo}" directInputSuggestions="false"
                                   defaultLabel="escolha o cargo..." >
                        <f:selectItems value="#{AdministrarMembrosMB.listCargos}" />
                    </rich:comboBox>
                    perfil:
                    <rich:comboBox width="200" value="#{AdministrarMembrosMB.nomePerfil}" directInputSuggestions="false"
                                   defaultLabel="escolha o perfil..." >
                        <f:selectItems value="#{AdministrarMembrosMB.listPerfis}" />
                    </rich:comboBox>
                </h:panelGrid>
                <a4j:commandButton value="cadastrar" action="#{AdministrarMembrosMB.cadastrarMembro}" reRender="membro-form" >
                    <rich:componentControl for="cadastro-membro-modal" operation="hide" event="onclick" />
                </a4j:commandButton>
            </h:form>
        </rich:modalPanel>
    </ui:composition>
</html>

